﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Reflection;
using Pixysoft.Weblications.Sango.Environment;
using Pixysoft.Weblications.Sango.Dao;
using Pixysoft.Weblications.Sango.Formular;
using Pixysoft.Weblications.Sango.Battle;
using Pixysoft.Weblications.Sango.Protocol.stage;
using Pixysoft.Weblications.Sango.Protocol;

namespace Pixysoft.Weblications.Sango.Command.stage_rve
{
    partial class SangoStageRveHandler
    {
        public stagerve_roomopen stagerve_roomopen(long stageserialcode, long sectionserialcode)
        {
            string userCode = SangoManager.Authentication();
            stagerve_roomopen response = ReflectionManager.CreatePojo<stagerve_roomopen>();
            response.Succeed = false;

            Entities.Usr_Profile profile = UsrProfileDao.getUsrProfile(userCode);
            Entities.War_Stage stage = WarStageHelper.searchStageByCode(stageserialcode);
            Entities.Sys_Section section = SysSectionHelper.searchSectionByCode(sectionserialcode);

            long battledate = StageFormular.GetRveBattleDate();
            RveStageTeam team = Battle.RveStageController.Instance.CreateStageRoom(profile, stage, section, battledate);

            response.rve = team.Battledate;
            response.rvecode = team.Roomcode;
            response.Succeed = true;
            return response;
        }


    }
    public interface stagerve_roomopen : ISangoResponse
    {
        long rvecode { get;set;}
        long rve { get;set;}
    }
}
